package sensor;

import java.util.Vector;

public enum SensorType {
	ELECTRIC_SENSOR, GAS_SENSOR, LIGHT_SENSOR, PR_SENSOR, RF_SENSOR, TEMPERATURE_SENSOR, WATER_SENSOR, WINDOW_SENSOR;

	public static SensorType match(String s) {
		for (SensorType t : SensorType.values()) {
			if (t.toString().equalsIgnoreCase(s))
				return t;
		}
		return null;
	}

	public static Vector<SensorType> toDialogList() {
		Vector<SensorType> list = new Vector<SensorType>();
		list.add(GAS_SENSOR);
		list.add(WATER_SENSOR);
		list.add(ELECTRIC_SENSOR);
		list.add(PR_SENSOR);
		list.add(LIGHT_SENSOR);
		list.add(TEMPERATURE_SENSOR);
		list.add(WINDOW_SENSOR);
		return list;
	}

	@Override
	public String toString() {
		switch (this) {
		case WINDOW_SENSOR:
			return "Window Sensor";
		case GAS_SENSOR:
			return "Gas Sensor";
		case WATER_SENSOR:
			return "Water Sensor";
		case ELECTRIC_SENSOR:
			return "Electric Sensor";
		case RF_SENSOR:
			return "RFID Sensor";
		case TEMPERATURE_SENSOR:
			return "Temperature Sensor";
		case LIGHT_SENSOR:
			return "Light Sensor";
		case PR_SENSOR:
			return "Presence Sensor";
		}
		return "Sensor";
	}

}
